package com.sea.human.service.impl;

import com.codecrane.core.power.entity.PowerGroup;
import com.codecrane.core.power.entity.PowerUser;
import com.sea.human.entity.Performance;
import com.sea.human.entity.PerformanceDetail;
import com.sea.human.mapper.PerformanceDetailMapper;
import com.sea.human.mapper.PerformanceMapper;
import com.sea.human.service.PerformanceDetailService;
import com.sea.human.service.PerformanceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


/**
 * @author 陈鸿飞
 */
@Service
public class PerformanceDetailServiceImpl implements PerformanceDetailService {

    @Autowired
    private PerformanceDetailMapper performanceDetailMapper;

    @Override
    public List<PerformanceDetail> findByCnd(PerformanceDetail performanceDetail) {
        return performanceDetailMapper.findByCnd(performanceDetail);
    }

    @Override
    public int save(PerformanceDetail performanceDetail) {
        return performanceDetailMapper.insert(performanceDetail);
    }

    @Override
    public PerformanceDetail findById(Integer id) {
        return performanceDetailMapper.findById(id);
    }

    @Transactional(rollbackFor = Exception.class)
    @Override
    public int usave(PerformanceDetail performanceDetail) {
        return performanceDetailMapper.update(performanceDetail);
    }

    @Override
    public int delete(Integer id) {
        return performanceDetailMapper.delete(id);
    }

    @Override
    public Integer findTotalWeight(Integer performanceId) {
        return performanceDetailMapper.findTotalWeight(performanceId);
    }

    @Override
    public List<PerformanceDetail> export(PerformanceDetail performanceDetail) {
        return performanceDetailMapper.export(performanceDetail);
    }
}
